﻿{extend name='base'}
<!-- meta -->

{block name='seo'}
<title>文章列表</title>
<link rel="stylesheet" href="__STATIC__/lib/zTree/v3/css/zTreeStyle/zTreeStyle.css" type="text/css">
</head>
<body>
{/block}

{include file='base/header'/}
{include file='base/menu'/}

{block name='content'}
<section class="Hui-article-box">
	<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 文章管理 <span class="c-gray en">&gt;</span> 文章列表 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
	<div class="Hui-article">
		<div class="pos-a" style="width:150px;left:0;top:0; bottom:0; height:100%; border-right:1px solid #e5e5e5; background-color:#f5f5f5">
			<ul id="treeDemo" class="ztree">
			</ul>
		</div>
		<div style="margin-left:150px;">
			<div class="pd-20">
				
				<div class="cl pd-5 bg-1 bk-gray mt-20"> <span class="l"><a href="javascript:;" onclick="datadel()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a> <a class="btn btn-primary radius" onclick="product_add('添加文章','product-add.html')" href="/houtai.php/article/add.html"><i class="Hui-iconfont">&#xe600;</i> 添加文章</a></span> <span class="r">共有数据：<strong>{$article|count}</strong> 条</span> </div>
				<div class="mt-20">
					<table class="table table-border table-bordered table-bg table-hover table-sort">
						<thead>
							<tr class="text-c">
								<th width="40"><input name="" type="checkbox" value=""></th>
								<th width="40">ID</th>
								<th width="60">缩略图</th>
								<th width="100">文章标题</th>
								<th>描述</th>
								<th width="100">所属栏目</th>
								<th width="60">创建时间</th>
								<th width="60">更新时间</th>
								<th width="100">操作</th>
							</tr>
						</thead>
						<tbody>
							{volist name='article' id='vo'}
								<tr class="text-c va-m">
									<td><input name="" type="checkbox" value=""></td>
									<td>{$vo.id}</td>
									<td><img src="{$vo.thumb}" width="100px" alt=""></td>
									<td>{$vo.name}</td>
									<td>{$vo.intr}</td>
									<td>
									{volist name='channel' id='v'}
										{eq name='$vo.cid' value='$v.id'}
											{$v.name}
										{/eq}
									{/volist}
									</td>
									<td>{$vo.create_time}</td>
									<td>{$vo.update_time}</td>
									<td><a style="text-decoration:none" class="ml-5" href="#" title="编辑"><i class="Hui-iconfont">&#xe6df;</i></a>
									<a style="text-decoration:none" class="ml-5" href="#" title="删除"><i class="Hui-iconfont">&#xe6e2;</i></a></td>
								</tr>
							{/volist}

						</tbody>
					</table>
				</div>
			</div>
		</div>

	</div>
</section>
{/block}

{include file='base/footer'/}

{block name='js'}
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="__STATIC__/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="__STATIC__/lib/datatables/1.10.15/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="__STATIC__/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript" src="__STATIC__/lib/zTree/v3/js/jquery.ztree.all-3.5.min.js"></script>
<script type="text/javascript">
var setting = {
	view: {
		dblClickExpand: false,
		showLine: false,
		selectedMulti: false
	},
	data: {
		simpleData: {
			enable:true,
			idKey: "id",
			pIdKey: "pId",
			rootPId: ""
		}
	},
	callback: {
		beforeClick: function(treeId, treeNode) {
			window.location.href = '/houtai.php/article/index/' + treeNode.id;
		}
	}
};

var zNodes =[
	
	{volist name='channel' id='vo'}
		{ id:{$vo.id}, pId:{$vo.pid}, name:"{$vo.name}",open:true},
	{/volist}
];

var code;

function showCode(str) {
	if (!code) code = $("#code");
	code.empty();
	code.append("<li>"+str+"</li>");
}

$(document).ready(function(){
	var t = $("#treeDemo");
	t = $.fn.zTree.init(t, setting, zNodes);
	demoIframe = $("#testIframe");
	demoIframe.bind("load", loadReady);
	var zTree = $.fn.zTree.getZTreeObj("tree");
	zTree.selectNode(zTree.getNodeByParam("id",'11'));
});

$('.table-sort').dataTable({
	"aaSorting": [[ 1, "desc" ]],//默认第几个排序
	"bStateSave": true,//状态保存
	"aoColumnDefs": [
	  {"orderable":false,"aTargets":[0,7]}// 制定列不参与排序
	]
});

</script>
{/block}

<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>